from odoo import  api,fields,models


class EpidemicRecord(models.Model):
    _name = 'epidemic.record'

    name=fields.Char(string='姓名')
    date=fields.Date(string='确诊日期')
    state=fields.Char(string='省')
    city=fields.Char(string='市')
    county=fields.Char(string='县/区')
    street=fields.Char(string='具体地址')
    ill_type=fields.Char(string='感染方式')
    within_or_abroad=fields.Selection([('withn','境内'),('abroad','境外')],string='境内境外感染')
    is_ill=fields.Boolean(string='是否确诊')
    begin_lsolation_data=fields.Date(string='起始隔离日期')
    lsolation_mode=fields.Selection([('home','居家隔离'),('focus','集中隔离')],string='隔离方式')
    create_user_id=fields.Many2one('res.users',string='填报人',default=lambda self: self.env.uid)
    note=fields.Text(string="说明")
    test_float=fields.Float(string="测试浮点数字段")
    test_int=fields.Integer(string="测试整型数字段")

    fuzhu_create_user_ids=fields.Many2many('res.users','epidemic_record_res_users_rel',column1="record_id",column2="user_id",string="辅助填报人")

    # 姓名、日期、省、市、区/县、性别、年龄、就业状态、具体地址、感染方式、境内/境外感染
    # name = fields.Char(string='姓名')
    # date = fields.Date(string='确诊日期')   # xxxx年xx月xx日
    # state = fields.Char(string='省')
    # city = fields.Char(string='市')
    # county = fields.Char(string='区/县')
    # street = fields.Char(string='具体地址')
    # ill_type = fields.Char(string='感染方式')
    # within_or_abroad = fields.Selection([('within', '境内'), ('abroad', '境外')], default='within', string='境内/境外感染')